package com.itheima.a05tcpdemo1;

import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;

public class Client {
    public static void main(String[] args) throws IOException {
        //客户端
        //创建Socket对象,去连接服务器
        Socket socket = new Socket("127.0.0.1",6666);

        //通过socket对象,获取输出流,写数据
        OutputStream os = socket.getOutputStream();
//        OutputStreamWriter osw = new OutputStreamWriter(os);
        os.write("哈哈哈就是f你".getBytes());

        //释放资源
//        os.close();
        socket.close();
    }
}
